package com.awenhui.demo.module.samsql.dao;

import com.awenhui.demo.module.samsql.model.entity.SamSqlEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 通用sql查询mapper
 *
 * @author yuxf
 * @version 1.0
 * @date 2021/2/8 9:14
 */
@Mapper
public interface SamSqlMapper {


    @Select("select * from t_sam_sql where sql_code=#{sqlCode}")
    SamSqlEntity getSqlByCode(String sqlCode);

    /**
     * 查询列表
     *
     * @param sql
     * @return
     */
    @Select("${sql}")
    List<LinkedHashMap<String, Object>> getSqlResult(String sql);

    /**
     * 查询单个对象
     *
     * @param sql
     * @return
     */
    @Select("${sql}")
    LinkedHashMap<String, Object> findSqlResult(String sql);

}
